1. Field of the Invention
The present invention relates to a technique for processing an ROM image, and more particularly to a technique for processing an ROM image when electrical power supplied to a laser printer has been interrupted.
2. Description of the Related Art
Generally, a laser printer performs accurate operations and communicates with a computer. Moreover, the laser printer has various functions because of supplying of emulation modes such as KSSM, PCL, and the like. Thus, the laser printer has a separate microprocessor mounted therein to perform printing according under the control of a bios which is stored in a ROM. In general, the bios is stored in a one time programmable ROM or an erasable and programmable ROM (hereinafter, referred to as an EPROM). The ROM in which the bios is stored is not damaged as long as a physical impact is not applied to the ROM and the recorded data is preserved even if the supplying of electrical power is interrupted.
As described above, according to the present invention, the ROM image can be freely read from and written in the flash memory which preserves the recorded data even if the supplying of electrical power is interrupted. With bugs found in the bios are corrected or the bios is upgraded after the product and sale of the laser printer, the user can obtain the corrected bios or the upgraded bios from a manufacturer through a communication line or an internet site so as to replace the bios having bugs or the old version of the bios with the corrected bios or the new version of the bios. Accordingly, a reliability of the product can be increased.
An earlier Korean patent application discloses a method of downloading a ROM image to a flash memory of a laser printer.
According to the above patent application, the laser printer has a function of downloading the ROM image and is provided with a RAM and the flash memory. The laser printer has the ROM image which is downloaded from a computer through a parallel port and stores the ROM image in the RAM. When a header is searched for and found in the ROM image, an ID field is read from the header. A flash memory changing table is set for a sector to be changed according to the ID field. Then, recorded data is deleted from the sector of the flash memory and the ROM image which is stored in the RAM is copied in the sector of the flash memory.
However, the Korean patent application discloses the method of downloading the ROM image to the flash memory of the laser printer only when electric power is normally supplied to the laser printer.
In a case when the program which is recorded in the bios area of the flash memory is deleted in order that the laser printer performs the downloading of the ROM image to the flash memory thereof, upon the supplying of electrical power to the laser printer being interrupted, the program which is recorded in the boot area is, in part, deleted. Accordingly, even though electrical power is supplied to the laser printer, the laser printer cannot be operated because the program in the boot area cannot be performed due to the partial damage in spite of jumping a jump code in the boot area to the bios.
In a case of the supplying of electrical power to the laser printer being interrupted before the bios ROM image in the RAM is copied to the flash memory after the program which is recorded in the bios area of the flash memory is deleted, even though electrical power is again supplied to the laser printer, the laser printer cannot be operated because the data which is recorded in the bios area has been deleted in spite of jumping the jump code in the boot area to the bios.
Moreover, in a case of supplying of electrical power to the laser printer has been interrupted during copying of the bios ROM image from the RAM to the bios area of the flash memory after the program which is recorded in the bios area of the flash memory is deleted, even though electrical power is supplied to the laser printer again, the laser printer cannot be normally operated because the ROM image has been abnormally downloaded to the bios area in spite of jumping the jump code in the boot area to the bios.
The following patents each discloses features in common with the present invention but do not teach or suggest the specifically recited technique for processing a ROM image when electrical power supplied to a laser printer has been interrupted: U.S. Pat. No. 5,812,745 to Kim et al., entitled Image Forming Apparatus, U.S. Pat. No. 5,784,174 to Fujino et al., entitled Method For Managing Memory Data At Power-Up, U.S. Pat. No. 5,473,735 to Murakami, entitled Page Printer, U.S. Pat. No. 5,420,667 to Kaneko et al., entitled Communication Control Apparatus For Monitoring A condition Of An Image Forming Apparatus And Inhibiting Transmission Of Data When A Power Supply Means Is Turned Off, U.S. Pat. No. 5,018,081 to Yamaguchi et al., entitled Printer With Automatic Restart, U.S. Pat. No. 5,131,077 to Indei, entitled Backup System For Printer Control Device, U.S. Pat. No. 4,926,373 to Takenaka, entitled Word Processor For Selecting A Control Program Stored IN The Word Processor When A Control Program In An Externally Detachable Memory Is Not Able To Be Read, U.S. Pat. No. 5,504,669 to Wakabayashi et al., entitled Information Processing Device And Accessory Control Device, U.S. Pat. No. 5,550,958 to Hattori, entitled Printer With Extension Memory Capacity That Provides Instructions Regarding Memory Installation, and U.S. Pat. No. 5,195,176 to Lung, entitled Method And Apparatus To Enhance Laser Printer Speed And Functionality.
The present invention has been made to overcome the above described problem of the related art. It is an object of the present invention to provide a technique for processing an ROM image when supplying of electrical power to a laser printer is interrupted during a down-loading of the ROM image, in which even if the ROM image is abnormally loaded in the flash memory due to the interruption of the supplying of electrical power, the ROM image is loaded to the flash memory again so that the laser printer can be normally operated.
To accomplish the above object of the present invention, according to the first aspect of the present invention, there is provided a technique for processing an ROM image when supplying of electrical power to a laser printer is interrupted, comprising the steps of:
detecting a check word in each program region of a flash memory in the laser printer;
checking whether or not the ROM image has been normally recorded in each program region based on the check word;
setting an operation mode of the laser printer to a normal mode when it has been determined that the ROM image has been normally recorded in each program region;
setting the operation mode of the laser printer to a down load mode when it has been determined that the ROM image has been abnormally recorded in each program region due to the interruption of supplying of electrical power to the laser during a down loading of the ROM image; and
loading the ROM image into the flash memory according to states of the ROM image when the operation mode is set to the down load mode.
The check words are detected in the detecting step, the check words being respectively recorded on a first and last position of each program region and including a region starting check word indicating a start of the ROM image stored in the program region of the flash memory and a region ending check word indicating an end of the ROM image stored in the program region of the flash memory.
The states of the ROM image include a first state in which the supply of electrical power is off in the laser printer during the deletion of the program regions, a second state in which the supply of electrical power is off in the laser printer before all program regions are deleted and the ROM image copied to the flash memory, and a third state in which the supply of electrical power is off in the laser printer during the copying of the ROM image to the flash memory after all program regions have been deleted.
The ROM image loading step comprises the steps of: downloading the ROM image through a parallel port and storing the ROM image in a RAM; determining whether or not a header is included in the ROM image stored in the RAM; reading an ID of the header when the ROM image which is stored in the RAM includes the header; setting a table of changes for the flash memory according to the ID; checking whether or not the header is included in all regions of the ROM image stored in the RAM; and copying the ROM image to the flash memory according to the states of the ROM image when the detecting of the header is completed throughout all regions of the ROM image stored in the RAM in the checking step.
When the ROM image is presented in the first state in the flash memory, the ROM image which is stored in the corresponding sector of the flash memory is deleted according to the table of changes for the flash memory and the ROM image which is stored in the RAM is copied in the corresponding sector of the flash memory according to the table of changes for the flash memory.
When the ROM image is presented in the second state in the flash memory, the ROM image which is stored in the RAM is copied in the corresponding sector of the flash memory according to the table of changes for the flash memory.
When the ROM image is presented in the third state in the flash memory, the ROM image which is stored in the flash memory is deleted according to the table of changes for the flash memory and the ROM image which is stored in the RAM is copied to the corresponding sector of the flash memory according to the table of changes for the flash memory.
The table of changes for the flash memory has numbers of bits corresponding to numbers of sectors of the flash memory, which are respectively set to one when the sector of the flash memory corresponding to one of the bits is changed and to zero when the sector of the flash memory corresponding to one of the bits is unchanged.
The header includes two bytes of a header field which indicates that the ROM image is an image to be changed and one byte of an ID field which indicates a kind of image to be changed.
The steps are preferably performed by a program which is stored in a boot area of the flash memory.
The boot area is provided with a routine for detecting whether or not the ROM image is normally recorded in the program region, a transmitting driver for storing the ROM image in the RAM after receiving the ROM image which is transmitted through the parallel port, a RAM driver for setting the table of changes for the flash memory by reading the ID after it is determined whether or not the header is presented in the RAM, and a flash memory driver for copying the ROM image in the RAM to the corresponding sector of the flash memory after the ROM image is deleted from the corresponding sector of the flash memory according to the table of changes for the flash memory.